<template>
	<view class="home">
		<cmd-nav-bar :fixed="true" :back='false' @backall="backall" left-text="进度查询"  right-text="" title="" font-color="#464c5b" background-color="white"></cmd-nav-bar>
		<view class="moban"></view>
		<view class="process_content" v-for="item in dataval">
			<view class="header_bottom">
				<view class="process_header">
					<text class="text_">预约单号:</text>
					<text class="number_">{{item.dog_numbering}}</text>
				</view>
			</view>
			<view class="process_body">
				<view class="pro_cen">
					<view class="pro_key">
						宠物昵称
					</view>
					<view class="pro_name">
						{{item.dog_nickname}}
					</view>
				</view>
					<view class="pro_cen">
					<view class="pro_key">
						创建时间
					</view>
					<view class="pro_name">
						{{item.created_at}}
					</view>
				</view>
					<uni-steps class="home_header" :data="header_top" :active="state(item.dog_state)">
				</uni-steps>
			</view>
		</view>
	</view>
</template>
<script>
	import cmdNavBar from "@/components/cmd-nav-bar/cmd-nav-bar.vue"
	import uniSteps from "@/components/uni-steps/uni-steps.vue"
	
	export default {
		props: {},
		components: {
			cmdNavBar,
			uniSteps
		},
		data() {
			return {
				dataval:[],
				header_top: [{
					title: "提交申请"
				}, {
					title: "受理完成"
				}, ],
			}
		},
		methods: {
			backall(s){
				uni.redirectTo({
					"url": '/',
				});
			},
			state(val){
				switch(val){
					case '1':
					return 0;
					break;
					case '2':
						return 1;
					break;
				}
			},
			retrievedata(){
				this.$apifn.GetMyDog({}).then((res)=>{
					 if(res.data.Response.code == 200){
						 // console.log(res.data.Response.data[0].user_dog)
						 this.dataval = res.data.Response.data[0].user_dog;
					 }
				 }).catch((ret)=>{ 
					  
				});
			}
		},
		watch: {},

		onReachBottom() { //页面上拉触底事件的处理函数
        
		},
		onPullDownRefresh() { //监听用户下拉动作，一般用于下拉刷新
			//需要在 pages.json 里，找到的当前页面的pages节点，并在 style 选项中开启 enablePullDownRefresh
			//uni.startPullDownRefresh(); 开启
			// uni.stopPullDownRefresh(); 关闭
		},
		onUnload() { //监听页面卸载

		},
		onHide() { //监听页面隐藏

		},
		onLoad() { // 替代 created 监听页面加载，其参数为上个页面传递的数据，参数类型为Object（用于页面传参），参考示例

		},
		onReady() { //替代 mounted 监听页面初次渲染完成
		this.retrievedata()
		},

		onShow() { //监听页面显示
			//生命周期
		}
	}
</script>
<style lang="scss" scoped>
	.home {
		width: 100%;
		height: 100%;
	}

	.moban {
		width: 100%;
		height: 92upx;
	}

	.process_content {
		width: 90%;
		height: 300upx;
		margin: 30upx auto auto auto;
		background: white;
		border-radius: 15upx;

		.header_bottom {
			width: 100%;
			height: 50upx;
			border-bottom: 1px solid #F4F5F6;

			.process_header {
				display: flex;
				width: 90%;
				margin: auto;

				text {
					height: 50upx;
					line-height: 50upx;
				}

				.text_ {
					width: 30%;
					border-left: 3px solid red;
					text-indent: 15upx;
				}

				.number_ {
					// width: 69%;
				}
			}
		}

			.process_body {
				width: 100%;
				height: 300upx;
				border-bottom: 1px solid #F4F5F6;
				.pro_cen{
					display: flex;
					width: 90%;
					height: 70upx;
					margin:auto;
					view{
						height: 70upx;
						line-height: 70upx;
						color: #464c5b;
					}
					.pro_key{
						width: 40%;
					}
					.pro_name{
						width: 60%;
						text-align: right;
					}
				}
			}
	.home_header{
		width: 90%;
		margin: auto;
	}
	}
</style>
